import request from '@/utils/request'

export const getList = (params: any, page: number, limit: number) =>
  request({
    url: `/api/group/list?page=${page}&limit=${limit}`,
    method: 'get',
    params
  })
export const createGroup = (data: any) =>
  request({
    url: '/api/group/create',
    method: 'post',
    data
  })

export const updateGroup = (id: number, data: any) =>
  request({
    url: `/api/group/${id}`,
    method: 'put',
    data
  })

export const getGroup = (id: number) =>
  request({
    url: `/api/group/${id}`,
    method: 'get',
  })

export const deleteGroup = (id: number) =>
  request({
    url: `/api/group/${id}`,
    method: 'delete'
  })

export const deleteCollectGroup = (data: any) =>
  request({
    url: `/api/group/deleteCollect`,
    method: 'delete',
    data
  })

export const getGroupCollect = () =>
  request({
    url: '/api/group/collect',
    method: 'get',
  })
